Welcome Guest | Sign in | Register

Home > C Programming > printf() and scanf() > Questions and Answers

01. What is the output of the following code?
#include "stdio.h"
extern int a;
main(){
printf("\na=%d",a);
return 0;

A. a=0 B. a=garbage value
C. error D. none of these

Answer and Explanation

Answer: error

Explanation:
Linking undefined symbol.

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
02. What is the output of the following code?
#include "stdio.h"
int a;
main(){
printf("\n a= %d",a);
return 0;
}
A. a=0 B. a=garbage value
C. error D. none of these

Answer and Explanation

Answer: a=0

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
03. What is the output of the following code?
#include "stdio.h"
extern int a;
main(){
printf("\n a=%d",a);
return 0;
}
int a; 
A. a=0 B. error
C. nothing display on screen D. none of these

Answer and Explanation

Answer: a=0

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
04.  What is the output of the following code?
#include "stdio.h"
extern int a;
main(){
printf("\n a=%d",a);
return 0;
}
int a=5;
A. a=0 B. a=5
C. a=garbage value D. error

Answer and Explanation

Answer: a=5

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
05. What is the output of the following code?
void main(){
printf("%d%d%d",50,100);
}
A. 50,100 B. 50,100,garbage
C. 50,100,0 D. 0,50,100

Answer and Explanation

Answer: 50,100,garbage

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
06. What is the output of the following program?
void main(){
a=3.5;
printf("%d",a);
A. 3.5 B. 3
C. error D. garbage

Answer and Explanation

Answer: error

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
07. What is the output of the following program?
void main(){
printf("%d%d",100,200,300);
}  
A. 100 200 B. 200 300
C. 300 200 D. 100 200 300

Answer and Explanation

Answer: 100 200

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
08.  What will be the output of the following program?
main()
{
printf(3+â??Gyantonicâ??+4);
}
A. ntonic B. tonic
C. ic D. nic

Answer and Explanation

Answer: ic

Explanation:
Gyantonic is a constant string and statement printf(3+â??Gyantonicâ??+4); will skip seven(3 + 4) characters of the string before printing. 

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
09. What is the output of the following program?
void main(){
int a;
a=3+5*5+3;
printf("%d",a);
}
A. 43 B. 64
C. 31 D. none of these

Answer and Explanation

Answer: 31

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
10. What is the output of following program?
void main(){
printf("%d%d",47%5,47%-5);
printf("%d%d%d",-47%5,-47%-5,5%7);

A. 2, -2, -2, -2, 5 B. 2,2,-2,-2,5
C. 2,-2,2,-2,5 D. 2,2,-2,-2,0

Answer and Explanation

Answer: 2,2,-2,-2,5

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum



Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved © 2012-2015 SoftLucent.